var edit_form_panel = Ext.create("Ext.form.Panel", {
	url: "",
	buttonAlign: "center",
	bodyStyle: "padding: 10px;",
	defaultType : "textfield",
	items: [{
		fieldLabel: "委托业务",
		emptyText: "请选择委托业务",
		name: "",
		width: "100%"
	},
	{
		xtype: "combo",
		fieldLabel: "委托人",
		emptyText: "请选择委托人姓名",
		name: "",
		//allowBlank: false,//是否允许为空
		editable: false,//是否可编辑
		lazyInit: false,//延时初始化下拉列表，默认为true
		triggerAction: 'all',
		valueField: 'value',
		width: "100%",
		store: new Ext.data.ArrayStore({
			fields: ['value', 'text'],
			data: [
					["1", "张三"],
					["0", "李四"]
			],
		}),
	},
	{
		xtype: "combo",
		fieldLabel: "被委托人",
		emptyText: "请选择被委托人姓名",
		name: "",
		//allowBlank: false,//是否允许为空
		editable: false,//是否可编辑
		lazyInit: false,//延时初始化下拉列表，默认为true
		triggerAction: 'all',
		valueField: 'value',
		width: "100%",
		store: new Ext.data.ArrayStore({
			fields: ['value', 'text'],
			data: [
					["1", "张三"],
					["0", "李四"]
			],
		}),
	},
	{
		xtype: "datefield",
		format: "Y-m-d",
		editable: false,
		fieldLabel: "委托开始时间",
		emptyText: "请选择委托开始时间",
		name: "",
		width: "100%"
	},
	{
		xtype: "datefield",
		format: "Y-m-d",
		editable: false,
		fieldLabel: "被委结束时间",
		emptyText: "请选择委托结束时间",
		name: "",
		width: "100%"
	},
	{  xtype : 'radiogroup',
	    fieldLabel : '是否启用',
	    name:'',
	    items : [
	    			{
	    				boxLabel : '置顶',
	    				name:'isTop',
	    				inputValue : '1'
	                }, 
	                {	
	                	boxLabel : '不置顶',
	                	name:'isTop',
	                	inputValue : '0',
	                	checked:true
	                }
	             ]
	},
	{
		xtype: 'textarea',
		labelWidth: 100,
		fieldLabel: '委托原因',
		width: 400
	}
],
	buttons: [{
		text: "保存",
		formBind: true, // only enabled once the form is valid
		disabled: true,
		handler: function() {
			var form = this.up("form").getForm();
			if (form.isValid()) {
				form.submit({
					waitMsg: "保存中...",
					success: function(form, action) {
						var message = action.result.result;
						Ext.Msg.alert("提示", message);
						edit_form_panel_win.close();
						dataStore.load();
					},
					failure: function(form, action) {
						Ext.Msg.alert("提示", "操作失败！");
					}
				});
			}
		}
	}]
});

var edit_form_panel_win = Ext.create("Ext.Window", {
	title: "委托信息修改",
	closeAction: "hide",
	width: 450,
	items: edit_form_panel
});

function myEdit(id) {
	/*Ext.Ajax.request({
		url: "",
		method: "POST",
		success: function(response) {
			var json = Ext.JSON.decode(response.responseText);
			edit_form_panel.getForm().reset();
			edit_form_panel.getForm().setValues(json.result);
			edit_form_panel_win.show();
		},
		failure: function(response) {
			Ext.Msg.alert("提示", "操作失败!");
		}
	});*/
	edit_form_panel.getForm().reset();
	edit_form_panel_win.show();
} // #myEdit
